Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Fix allowed change to work per version #1029

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

CrispyDrone
Copy link
Contributor

@CrispyDrone CrispyDrone commented Aug 30, 2020

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix

⤵️ What is the current behavior?

In case a package is installed in multiple projects, allowed change will only consider the highest installed version instead of looking at each version independently. This results in unexpected updates for packages outside of the allowed change range. For example, if one project has version 12.0.3 for Newtonsoft.Json but another one is still working with version 6.0.3, even when specifying --change Minor, it will try to update the 6.0.3 to 12.X.X.

We cannot make assumptions about other projects as we don't know if they will end up being loaded into the same process.

This fix ensures that different versions of the same package are only grouped, if that doesn't result in allowed change being ignored.

🆕 What is the new behavior (if this is a feature change)?

N/A

💥 Does this PR introduce a breaking change?

No.

🐛 Recommendations for testing

Test whether the correct updates are being applied when there are multiple versions of the same package across different projects that are outside of the allowed change range for each other.

Test whether the correct updates are being applied if there are multiple versions of the same package across different projects that are inside the allowed change range of each other.

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Relevant documentation was updated (no relevant documentation)

Added test for `PackageUpdatesLookup` that demonstrates that updates are
incorrectly applied across different projects. `AllowedChange` needs to
be applied to each version independently, not across all projects as we
currently cannot guarantee that these different projects are loaded in
the same process at runtime.
In case a package is installed in multiple projects, allowed change will
only consider the highest installed version instead of looking at each
version independently.

This would result in an update being applied that is outside of the
allowed change range for projects for which the version of another
project with the highest version is considered outside of their allowed
change range.
@CrispyDrone CrispyDrone changed the title Fix allowed change to work per project Fix allowed change to work per version Aug 30, 2020
@AnthonySteele AnthonySteele merged commit 07a8db8 into NuKeeperDotNet:master Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants